<?php
$ups = $_FILES['upfile'];
$upfname = $ups['name'];
$alt = pathinfo($upfname, PATHINFO_BASENAME);
$fn = uniqid() . '.' . pathinfo($upfname, PATHINFO_EXTENSION);
move_uploaded_file($ups['tmp_name'], 'upload/user/' . $fn);
$arr = ['errno' => 0, 'data' => ['url' => 'upload/user/' . $fn, 'alt' => $alt, 'href' => 'http://www.baidu.com']];
echo json_encode($arr);